home *** CD-ROM | disk | FTP | other *** search
/ MacHome 2001 January / MacHome Magazine Demo Disc January 2001.iso / mac / Software / Applications / PageSpinner 3.0.1.sea / PageSpinner 3.0.1 / Examples / JavaScript / Cookie Example < prev    next >
MacBinary  |  2000-10-16  |  11.5 KB  |  [TEXT/JyWs]

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: MacBinary (archive/macBinary).

You can browse this item here: Cookie Example

ConfidenceProgramDetectionMatch TypeSupport
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Mon Oct 16 10:20:00 2000, modified Mon Oct 16 10:20:00 2000, creator 'JyWs', type ASCII, 9097 bytes "Cookie Example" , at 0x2409 2334 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% lsar MacBinary default
100% xdgMime text/html default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[JyWs]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0e 43 6f 6f 6b 69 65 | 20 45 78 61 6d 70 6c 65 |..Cookie| Example|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4a 79 57 | 73 00 00 00 00 00 00 00 |.TEXTJyW|s.......|
|00000050| 00 00 00 00 00 23 89 00 | 00 09 1e b6 10 bf 10 b6 |.....#..|........|
|00000060| 10 bf 10 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 17 bb 00 00 |........|........|
|00000080| 3c 68 74 6d 6c 3e 0d 3c | 68 65 61 64 3e 0d 3c 74 |<html>.<|head>.<t|
|00000090| 69 74 6c 65 3e 4a 61 76 | 61 53 63 72 69 70 74 20 |itle>Jav|aScript |
|000000a0| 43 6f 6f 6b 69 65 73 20 | 44 65 6d 6f 3c 2f 74 69 |Cookies |Demo</ti|
|000000b0| 74 6c 65 3e 0d 0d 3c 73 | 63 72 69 70 74 20 6c 61 |tle>..<s|cript la|
|000000c0| 6e 67 75 61 67 65 3d 22 | 4a 61 76 61 53 63 72 69 |nguage="|JavaScri|
|000000d0| 70 74 22 20 20 74 79 70 | 65 3d 22 74 65 78 74 2f |pt" typ|e="text/|
|000000e0| 6a 61 76 61 73 63 72 69 | 70 74 22 3e 0d 3c 21 2d |javascri|pt">.<!-|
|000000f0| 2d 0d 2f 2a 20 0d 09 43 | 6f 6f 6b 69 65 73 20 44 |-./* ..C|ookies D|
|00000100| 65 6d 6f 0d 09 42 79 20 | 4a 65 72 72 79 20 41 6d |emo..By |Jerry Am|
|00000110| 61 6e 2c 20 4f 70 74 69 | 6d 61 20 53 79 73 74 65 |an, Opti|ma Syste|
|00000120| 6d 2c 31 39 39 36 2d 32 | 30 30 30 2e 0d 20 20 20 |m,1996-2|000.. |
|00000130| 09 43 6f 6f 6b 69 65 20 | 46 75 6e 63 74 69 6f 6e |.Cookie |Function|
|00000140| 73 20 77 72 69 74 74 65 | 6e 20 62 79 20 42 69 6c |s writte|n by Bil|
|00000150| 6c 20 44 6f 72 74 63 68 | 2c 20 68 49 64 61 68 6f |l Dortch|, hIdaho|
|00000160| 20 44 65 73 69 67 6e 2e | 0d 0d 09 50 61 72 74 20 | Design.|...Part |
|00000170| 6f 66 20 74 68 65 20 50 | 61 67 65 53 70 69 6e 6e |of the P|ageSpinn|
|00000180| 65 72 20 64 69 73 74 72 | 69 62 75 74 69 6f 6e 2e |er distr|ibution.|
|00000190| 0d 0d 09 57 65 20 77 69 | 6c 6c 20 6e 6f 74 20 62 |...We wi|ll not b|
|000001a0| 65 20 68 65 6c 64 20 72 | 65 73 70 6f 6e 73 69 62 |e held r|esponsib|
|000001b0| 6c 65 20 66 6f 72 20 61 | 6e 79 20 75 6e 77 61 6e |le for a|ny unwan|
|000001c0| 74 65 64 20 0d 09 65 66 | 66 65 63 74 73 20 64 75 |ted ..ef|fects du|
|000001d0| 65 20 74 6f 20 74 68 65 | 20 75 73 61 67 65 20 6f |e to the| usage o|
|000001e0| 66 20 74 68 69 73 20 73 | 63 72 69 70 74 20 6f 72 |f this s|cript or|
|000001f0| 20 61 6e 79 20 64 65 72 | 69 76 61 74 69 76 65 2e | any der|ivative.|
|00000200| 20 20 0d 09 4e 6f 20 77 | 61 72 72 61 6e 74 65 65 | ..No w|arrantee|
|00000210| 73 20 66 6f 72 20 75 73 | 61 62 69 6c 69 74 79 20 |s for us|ability |
|00000220| 66 6f 72 20 61 6e 79 20 | 73 70 65 63 69 66 69 63 |for any |specific|
|00000230| 20 61 70 70 6c 69 63 61 | 74 69 6f 6e 20 0d 09 61 | applica|tion ..a|
|00000240| 72 65 20 67 69 76 65 6e | 20 6f 72 20 69 6d 70 6c |re given| or impl|
|00000250| 69 65 64 2e 0d 0d 09 59 | 6f 75 20 61 72 65 20 66 |ied....Y|ou are f|
|00000260| 72 65 65 20 74 6f 20 75 | 73 65 20 61 6e 64 20 6d |ree to u|se and m|
|00000270| 6f 64 69 66 79 20 74 68 | 69 73 20 73 63 72 69 70 |odify th|is scrip|
|00000280| 74 2c 0d 09 69 66 20 63 | 72 65 64 69 74 73 20 61 |t,..if c|redits a|
|00000290| 72 65 20 6b 65 70 74 20 | 69 6e 20 74 68 65 20 73 |re kept |in the s|
|000002a0| 6f 75 72 63 65 20 63 6f | 64 65 0d 2a 2f 0d 0d 09 |ource co|de.*/...|
|000002b0| 76 61 72 20 63 6f 6f 6b | 69 65 56 69 73 69 74 49 |var cook|ieVisitI|
|000002c0| 44 20 09 3d 20 27 6d 79 | 5f 4c 61 73 74 56 69 73 |D .= 'my|_LastVis|
|000002d0| 69 74 27 3b 09 0d 09 76 | 61 72 20 63 6f 6f 6b 69 |it';...v|ar cooki|
|000002e0| 65 4e 75 6d 56 69 73 69 | 74 49 44 20 09 3d 20 27 |eNumVisi|tID .= '|
|000002f0| 6d 79 5f 4e 75 6d 56 69 | 73 69 74 73 27 3b 09 0d |my_NumVi|sits';..|
|00000300| 0d 09 09 09 09 09 09 2f | 2f 20 43 68 61 6e 67 65 |......./|/ Change|
|00000310| 20 27 6d 79 5f 4c 61 73 | 74 56 69 73 69 74 27 20 | 'my_Las|tVisit' |
|00000320| 61 6e 64 20 27 6d 79 5f | 4e 75 6d 56 69 73 69 74 |and 'my_|NumVisit|
|00000330| 73 27 0d 09 09 09 09 09 | 09 2f 2f 20 74 6f 20 73 |s'......|.// to s|
|00000340| 6f 6d 65 74 68 69 6e 67 | 20 75 6e 69 71 75 65 20 |omething| unique |
|00000350| 66 6f 72 0d 09 09 09 09 | 09 09 2f 2f 20 74 68 65 |for.....|..// the|
|00000360| 20 63 75 72 72 65 6e 74 | 20 70 61 67 65 2c 20 6f | current| page, o|
|00000370| 72 20 65 6c 73 65 20 69 | 74 0d 09 09 09 09 09 09 |r else i|t.......|
|00000380| 2f 2f 20 77 6f 6e 27 74 | 20 77 6f 72 6b 20 63 6f |// won't| work co|
|00000390| 72 72 65 63 74 6c 79 20 | 69 66 20 6f 74 68 65 72 |rrectly |if other|
|000003a0| 20 75 73 65 73 0d 09 09 | 09 09 09 09 2f 2f 20 74 | uses...|....// t|
|000003b0| 68 69 73 20 73 63 72 69 | 70 74 21 0d 09 76 61 72 |his scri|pt!..var|
|000003c0| 20 67 4c 61 73 74 56 69 | 73 69 74 3b 0d 09 76 61 | gLastVi|sit;..va|
|000003d0| 72 20 67 4e 75 6d 56 69 | 73 69 74 73 3b 0d 0d 09 |r gNumVi|sits;...|
|000003e0| 53 65 74 4c 61 73 74 56 | 69 73 69 74 28 29 3b 09 |SetLastV|isit();.|
|000003f0| 2f 2f 20 45 78 65 63 75 | 74 65 20 77 68 65 6e 20 |// Execu|te when |
|00000400| 6c 6f 61 64 69 6e 67 20 | 70 61 67 65 0d 0d 09 66 |loading |page...f|
|00000410| 75 6e 63 74 69 6f 6e 20 | 47 65 74 4c 61 73 74 56 |unction |GetLastV|
|00000420| 69 73 69 74 20 28 29 0d | 09 7b 0d 0d 09 09 69 66 |isit ().|.{....if|
|00000430| 20 28 20 67 4c 61 73 74 | 56 69 73 69 74 20 3d 3d | ( gLast|Visit ==|
|00000440| 20 22 22 29 0d 09 09 7b | 0d 09 09 09 72 65 74 75 | "")...{|....retu|
|00000450| 72 6e 20 22 57 65 6c 63 | 6f 6d 65 20 74 6f 20 74 |rn "Welc|ome to t|
|00000460| 68 69 73 20 73 69 74 65 | 21 22 3b 0d 09 09 7d 0d |his site|!";...}.|
|00000470| 09 09 65 6c 73 65 20 0d | 09 09 7b 0d 09 09 09 76 |..else .|..{....v|
|00000480| 61 72 20 6f 6c 64 56 69 | 73 69 74 44 61 74 65 20 |ar oldVi|sitDate |
|00000490| 3d 20 6e 65 77 20 44 61 | 74 65 28 67 4c 61 73 74 |= new Da|te(gLast|
|000004a0| 56 69 73 69 74 29 3b 0d | 09 09 09 72 65 74 75 72 |Visit);.|...retur|
|000004b0| 6e 20 09 22 57 65 6c 63 | 6f 6d 65 20 62 61 63 6b |n ."Welc|ome back|
|000004c0| 2c 20 79 6f 75 72 20 6c | 61 73 74 20 76 69 73 69 |, your l|ast visi|
|000004d0| 74 20 74 6f 20 74 68 69 | 73 20 73 69 74 65 20 77 |t to thi|s site w|
|000004e0| 61 73 20 6f 6e 20 22 20 | 0d 09 09 09 09 09 2b 20 |as on " |......+ |
|000004f0| 67 4c 61 73 74 56 69 73 | 69 74 20 2b 22 2e 3c 42 |gLastVis|it +".<B|
|00000500| 52 3e 59 6f 75 20 68 61 | 76 65 20 62 65 65 6e 20 |R>You ha|ve been |
|00000510| 68 65 72 65 20 22 20 0d | 09 09 09 09 09 2b 20 67 |here " .|.....+ g|
|00000520| 4e 75 6d 56 69 73 69 74 | 73 20 2b 20 22 20 74 69 |NumVisit|s + " ti|
|00000530| 6d 65 22 20 2b 28 67 4e | 75 6d 56 69 73 69 74 73 |me" +(gN|umVisits|
|00000540| 3e 31 20 3f 20 22 73 22 | 20 3a 22 22 29 20 0d 09 |>1 ? "s"| :"") ..|
|00000550| 09 09 09 09 2b 22 20 62 | 65 66 6f 72 65 2e 22 0d |....+" b|efore.".|
|00000560| 09 09 7d 0d 09 7d 0d 0d | 0d 09 66 75 6e 63 74 69 |..}..}..|..functi|
|00000570| 6f 6e 20 53 65 74 4c 61 | 73 74 56 69 73 69 74 20 |on SetLa|stVisit |
|00000580| 28 6e 61 6d 65 2c 20 76 | 61 6c 75 65 29 20 0d 09 |(name, v|alue) ..|
|00000590| 7b 0d 09 09 76 61 72 20 | 6e 65 77 56 69 73 69 74 |{...var |newVisit|
|000005a0| 44 61 74 65 20 3d 20 6e | 65 77 20 44 61 74 65 28 |Date = n|ew Date(|
|000005b0| 29 3b 0d 09 09 76 61 72 | 20 65 78 70 44 61 74 65 |);...var| expDate|
|000005c0| 20 3d 20 6e 65 77 20 44 | 61 74 65 20 28 29 3b 20 | = new D|ate (); |
|000005d0| 0d 09 09 76 61 72 20 6e | 75 6d 56 69 73 69 74 73 |...var n|umVisits|
|000005e0| 20 3d 20 30 3b 0d 0d 09 | 09 09 2f 2f 20 54 68 65 | = 0;...|..// The|
|000005f0| 20 65 78 70 44 61 74 65 | 20 69 73 20 74 68 65 20 | expDate| is the |
|00000600| 64 61 74 65 20 77 68 65 | 6e 20 74 68 65 20 63 6f |date whe|n the co|
|00000610| 6f 6b 69 65 20 73 68 6f | 75 6c 64 0d 09 09 09 2f |okie sho|uld..../|
|00000620| 2f 20 65 78 70 69 72 65 | 2c 20 77 65 20 77 69 6c |/ expire|, we wil|
|00000630| 6c 20 6b 65 65 70 20 69 | 74 20 66 6f 72 20 61 20 |l keep i|t for a |
|00000640| 79 65 61 72 0d 09 09 65 | 78 70 44 61 74 65 2e 73 |year...e|xpDate.s|
|00000650| 65 74 54 69 6d 65 28 20 | 65 78 70 44 61 74 65 2e |etTime( |expDate.|
|00000660| 67 65 74 54 69 6d 65 28 | 29 20 2b 20 28 33 36 35 |getTime(|) + (365|
|00000670| 20 2a 20 32 34 20 2a 20 | 36 30 20 2a 20 36 30 20 | * 24 * |60 * 60 |
|00000680| 2a 20 31 30 30 30 29 20 | 29 3b 20 0d 0d 09 09 09 |* 1000) |); .....|
|00000690| 2f 2f 20 49 6e 66 6f 20 | 61 62 6f 75 74 20 6c 61 |// Info |about la|
|000006a0| 73 74 20 76 69 73 69 74 | 0d 09 09 69 66 20 28 47 |st visit|...if (G|
|000006b0| 65 74 43 6f 6f 6b 69 65 | 20 28 63 6f 6f 6b 69 65 |etCookie| (cookie|
|000006c0| 56 69 73 69 74 49 44 29 | 20 21 3d 20 6e 75 6c 6c |VisitID)| != null|
|000006d0| 29 0d 09 09 09 67 4c 61 | 73 74 56 69 73 69 74 20 |)....gLa|stVisit |
|000006e0| 3d 20 47 65 74 43 6f 6f | 6b 69 65 20 28 63 6f 6f |= GetCoo|kie (coo|
|000006f0| 6b 69 65 56 69 73 69 74 | 49 44 29 3b 0d 09 09 65 |kieVisit|ID);...e|
|00000700| 6c 73 65 0d 09 09 09 67 | 4c 61 73 74 56 69 73 69 |lse....g|LastVisi|
|00000710| 74 20 3d 20 22 22 3b 0d | 0d 09 09 69 66 20 28 47 |t = "";.|...if (G|
|00000720| 65 74 43 6f 6f 6b 69 65 | 20 28 63 6f 6f 6b 69 65 |etCookie| (cookie|
|00000730| 4e 75 6d 56 69 73 69 74 | 49 44 29 20 21 3d 20 6e |NumVisit|ID) != n|
|00000740| 75 6c 6c 29 0d 09 09 09 | 67 4e 75 6d 56 69 73 69 |ull)....|gNumVisi|
|00000750| 74 73 20 3d 20 47 65 74 | 43 6f 6f 6b 69 65 20 28 |ts = Get|Cookie (|
|00000760| 63 6f 6f 6b 69 65 4e 75 | 6d 56 69 73 69 74 49 44 |cookieNu|mVisitID|
|00000770| 29 3b 09 0d 09 09 65 6c | 73 65 0d 09 09 09 67 4e |);....el|se....gN|
|00000780| 75 6d 56 69 73 69 74 73 | 20 3d 20 30 3b 0d 0d 09 |umVisits| = 0;...|
|00000790| 09 09 2f 2f 20 55 73 65 | 20 65 76 61 6c 28 29 20 |..// Use| eval() |
|000007a0| 74 6f 20 63 6f 6e 76 65 | 72 74 20 61 20 73 74 72 |to conve|rt a str|
|000007b0| 69 6e 67 20 74 6f 20 61 | 20 6e 75 6d 62 65 72 0d |ing to a| number.|
|000007c0| 09 09 6e 75 6d 56 69 73 | 69 74 73 20 3d 20 65 76 |..numVis|its = ev|
|000007d0| 61 6c 28 67 4e 75 6d 56 | 69 73 69 74 73 29 20 2b |al(gNumV|isits) +|
|000007e0| 31 3b 09 0d 0d 09 09 09 | 2f 2f 20 53 74 6f 72 65 |1;......|// Store|
|000007f0| 20 69 6e 66 6f 20 61 62 | 6f 75 74 20 74 68 69 73 | info ab|out this|
|00000800| 20 76 69 73 69 74 0d 09 | 09 53 65 74 43 6f 6f 6b | visit..|.SetCook|
|00000810| 69 65 28 20 63 6f 6f 6b | 69 65 56 69 73 69 74 49 |ie( cook|ieVisitI|
|00000820| 44 2c 20 09 6e 65 77 56 | 69 73 69 74 44 61 74 65 |D, .newV|isitDate|
|00000830| 2c 20 65 78 70 44 61 74 | 65 29 3b 20 0d 09 09 53 |, expDat|e); ...S|
|00000840| 65 74 43 6f 6f 6b 69 65 | 28 20 63 6f 6f 6b 69 65 |etCookie|( cookie|
|00000850| 4e 75 6d 56 69 73 69 74 | 49 44 2c 20 6e 75 6d 56 |NumVisit|ID, numV|
|00000860| 69 73 69 74 73 2c 20 65 | 78 70 44 61 74 65 29 3b |isits, e|xpDate);|
|00000870| 20 0d 09 7d 0d 0d 20 20 | 20 20 2f 2f 20 2d 2d 2d | ..}.. | // ---|
|00000880| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000890| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000008a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000008b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 0d 20 20 20 |--------|----. |
|000008c0| 20 2f 2f 20 20 43 6f 6f | 6b 69 65 20 46 75 6e 63 | // Coo|kie Func|
|000008d0| 74 69 6f 6e 73 20 2d 20 | 53 65 63 6f 6e 64 20 48 |tions - |Second H|
|000008e0| 65 6c 70 69 6e 67 20 20 | 28 32 31 2d 4a 61 6e 2d |elping |(21-Jan-|
|000008f0| 39 36 29 0d 20 20 20 20 | 2f 2f 20 20 57 72 69 74 |96). |// Writ|
|00000900| 74 65 6e 20 62 79 3a 20 | 20 42 69 6c 6c 20 44 6f |ten by: | Bill Do|
|00000910| 72 74 63 68 2c 20 68 49 | 64 61 68 6f 20 44 65 73 |rtch, hI|daho Des|
|00000920| 69 67 6e 20 3c 42 44 4f | 52 54 43 48 40 4e 45 54 |ign <BDO|RTCH@NET|
|00000930| 57 2e 43 4f 4d 3e 0d 20 | 20 20 20 2f 2f 20 20 54 |W.COM>. | // T|
|00000940| 68 65 20 66 6f 6c 6c 6f | 77 69 6e 67 20 66 75 6e |he follo|wing fun|
|00000950| 63 74 69 6f 6e 73 20 61 | 72 65 20 72 65 6c 65 61 |ctions a|re relea|
|00000960| 73 65 64 20 74 6f 20 74 | 68 65 20 70 75 62 6c 69 |sed to t|he publi|
|00000970| 63 20 64 6f 6d 61 69 6e | 2e 0d 20 20 20 20 2f 2f |c domain|.. //|
|00000980| 0d 20 20 20 20 2f 2f 20 | 20 54 68 65 20 53 65 63 |. // | The Sec|
|00000990| 6f 6e 64 20 48 65 6c 70 | 69 6e 67 20 76 65 72 73 |ond Help|ing vers|
|000009a0| 69 6f 6e 20 6f 66 20 74 | 68 65 20 63 6f 6f 6b 69 |ion of t|he cooki|
|000009b0| 65 20 66 75 6e 63 74 69 | 6f 6e 73 20 64 69 73 70 |e functi|ons disp|
|000009c0| 65 6e 73 65 73 20 77 69 | 74 68 0d 20 20 20 20 2f |enses wi|th. /|
|000009d0| 2f 20 20 6d 79 20 65 6e | 63 6f 64 65 20 61 6e 64 |/ my en|code and|
|000009e0| 20 64 65 63 6f 64 65 20 | 66 75 6e 63 74 69 6f 6e | decode |function|
|000009f0| 73 2c 20 69 6e 20 66 61 | 76 6f 72 20 6f 66 20 4a |s, in fa|vor of J|
|00000a00| 61 76 61 53 63 72 69 70 | 74 27 73 20 6e 65 77 20 |avaScrip|t's new |
|00000a10| 62 75 69 6c 74 2d 69 6e | 0d 20 20 20 20 2f 2f 20 |built-in|. // |
|00000a20| 20 65 73 63 61 70 65 20 | 61 6e 64 20 75 6e 65 73 | escape |and unes|
|00000a30| 63 61 70 65 20 66 75 6e | 63 74 69 6f 6e 73 2c 20 |cape fun|ctions, |
|00000a40| 77 68 69 63 68 20 64 6f | 20 6d 6f 72 65 20 63 6f |which do| more co|
|00000a50| 6d 70 6c 65 74 65 20 65 | 6e 63 6f 64 69 6e 67 2c |mplete e|ncoding,|
|00000a60| 20 61 6e 64 0d 20 20 20 | 20 2f 2f 20 20 77 68 69 | and. | // whi|
|00000a70| 63 68 20 61 72 65 20 70 | 72 6f 62 61 62 6c 79 20 |ch are p|robably |
|00000a80| 6d 75 63 68 20 66 61 73 | 74 65 72 2e 0d 20 20 20 |much fas|ter.. |
|00000a90| 20 2f 2f 0d 20 20 20 20 | 2f 2f 20 20 54 68 65 20 | //. |// The |
|00000aa0| 6e 65 77 20 76 65 72 73 | 69 6f 6e 20 61 6c 73 6f |new vers|ion also|
|00000ab0| 20 65 78 74 65 6e 64 73 | 20 74 68 65 20 53 65 74 | extends| the Set|
|00000ac0| 43 6f 6f 6b 69 65 20 66 | 75 6e 63 74 69 6f 6e 2c |Cookie f|unction,|
|00000ad0| 20 74 68 6f 75 67 68 20 | 69 6e 0d 20 20 20 20 2f | though |in. /|
|00000ae0| 2f 20 20 61 20 62 61 63 | 6b 77 61 72 64 2d 63 6f |/ a bac|kward-co|
|00000af0| 6d 70 61 74 69 62 6c 65 | 20 6d 61 6e 6e 65 72 2c |mpatible| manner,|
|00000b00| 20 73 6f 20 69 66 20 79 | 6f 75 20 75 73 65 64 20 | so if y|ou used |
|00000b10| 74 68 65 20 46 69 72 73 | 74 20 48 65 6c 70 69 6e |the Firs|t Helpin|
|00000b20| 67 20 6f 66 0d 20 20 20 | 20 2f 2f 20 20 63 6f 6f |g of. | // coo|
|00000b30| 6b 69 65 20 66 75 6e 63 | 74 69 6f 6e 73 20 61 73 |kie func|tions as|
|00000b40| 20 74 68 65 79 20 77 65 | 72 65 20 77 72 69 74 74 | they we|re writt|
|00000b50| 65 6e 2c 20 79 6f 75 20 | 77 69 6c 6c 20 6e 6f 74 |en, you |will not|
|00000b60| 20 6e 65 65 64 20 74 6f | 20 63 68 61 6e 67 65 20 | need to| change |
|00000b70| 61 6e 79 0d 20 20 20 20 | 2f 2f 20 20 63 6f 64 65 |any. |// code|
|00000b80| 2c 20 75 6e 6c 65 73 73 | 20 79 6f 75 20 77 61 6e |, unless| you wan|
|00000b90| 74 20 74 6f 20 74 61 6b | 65 20 61 64 76 61 6e 74 |t to tak|e advant|
|00000ba0| 61 67 65 20 6f 66 20 74 | 68 65 20 6e 65 77 20 63 |age of t|he new c|
|00000bb0| 61 70 61 62 69 6c 69 74 | 69 65 73 2e 0d 20 20 20 |apabilit|ies.. |
|00000bc0| 20 2f 2f 0d 20 20 20 20 | 2f 2f 20 20 54 68 65 20 | //. |// The |
|00000bd0| 66 6f 6c 6c 6f 77 69 6e | 67 20 63 68 61 6e 67 65 |followin|g change|
|00000be0| 73 20 77 65 72 65 20 6d | 61 64 65 20 74 6f 20 53 |s were m|ade to S|
|00000bf0| 65 74 43 6f 6f 6b 69 65 | 3a 0d 20 20 20 20 2f 2f |etCookie|:. //|
|00000c00| 0d 20 20 20 20 2f 2f 20 | 20 31 2e 20 20 54 68 65 |. // | 1. The|
|00000c10| 20 65 78 70 69 72 65 73 | 20 70 61 72 61 6d 65 74 | expires| paramet|
|00000c20| 65 72 20 69 73 20 6e 6f | 77 20 6f 70 74 69 6f 6e |er is no|w option|
|00000c30| 61 6c 20 2d 20 74 68 61 | 74 20 69 73 2c 20 79 6f |al - tha|t is, yo|
|00000c40| 75 20 63 61 6e 20 6f 6d | 69 74 0d 20 20 20 20 2f |u can om|it. /|
|00000c50| 2f 20 20 20 20 20 20 69 | 74 20 69 6e 73 74 65 61 |/ i|t instea|
|00000c60| 64 20 6f 66 20 70 61 73 | 73 69 6e 67 20 69 74 20 |d of pas|sing it |
|00000c70| 6e 75 6c 6c 20 74 6f 20 | 65 78 70 69 72 65 20 74 |null to |expire t|
|00000c80| 68 65 20 63 6f 6f 6b 69 | 65 20 61 74 20 74 68 65 |he cooki|e at the|
|00000c90| 20 65 6e 64 0d 20 20 20 | 20 2f 2f 20 20 20 20 20 | end. | // |
|00000ca0| 20 6f 66 20 74 68 65 20 | 63 75 72 72 65 6e 74 20 | of the |current |
|00000cb0| 73 65 73 73 69 6f 6e 2e | 0d 20 20 20 20 2f 2f 0d |session.|. //.|
|00000cc0| 20 20 20 20 2f 2f 20 20 | 32 2e 20 20 41 6e 20 6f | // |2. An o|
|00000cd0| 70 74 69 6f 6e 61 6c 20 | 70 61 74 68 20 70 61 72 |ptional |path par|
|00000ce0| 61 6d 65 74 65 72 20 68 | 61 73 20 62 65 65 6e 20 |ameter h|as been |
|00000cf0| 61 64 64 65 64 2e 0d 20 | 20 20 20 2f 2f 0d 20 20 |added.. | //. |
|00000d00| 20 20 2f 2f 20 20 33 2e | 20 20 41 6e 20 6f 70 74 | // 3.| An opt|
|00000d10| 69 6f 6e 61 6c 20 64 6f | 6d 61 69 6e 20 70 61 72 |ional do|main par|
|00000d20| 61 6d 65 74 65 72 20 68 | 61 73 20 62 65 65 6e 20 |ameter h|as been |
|00000d30| 61 64 64 65 64 2e 0d 20 | 20 20 20 2f 2f 0d 20 20 |added.. | //. |
|00000d40| 20 20 2f 2f 20 20 34 2e | 20 20 41 6e 20 6f 70 74 | // 4.| An opt|
|00000d50| 69 6f 6e 61 6c 20 73 65 | 63 75 72 65 20 70 61 72 |ional se|cure par|
|00000d60| 61 6d 65 74 65 72 20 68 | 61 73 20 62 65 65 6e 20 |ameter h|as been |
|00000d70| 61 64 64 65 64 2e 0d 20 | 20 20 20 2f 2f 0d 20 20 |added.. | //. |
|00000d80| 20 20 2f 2f 20 20 46 6f | 72 20 69 6e 66 6f 72 6d | // Fo|r inform|
|00000d90| 61 74 69 6f 6e 20 6f 6e | 20 74 68 65 20 73 69 67 |ation on| the sig|
|00000da0| 6e 69 66 69 63 61 6e 63 | 65 20 6f 66 20 74 68 65 |nificanc|e of the|
|00000db0| 73 65 20 70 61 72 61 6d | 65 74 65 72 73 2c 20 61 |se param|eters, a|
|00000dc0| 6e 64 0d 20 20 20 20 2f | 2f 20 20 61 6e 64 20 6f |nd. /|/ and o|
|00000dd0| 6e 20 63 6f 6f 6b 69 65 | 73 20 69 6e 20 67 65 6e |n cookie|s in gen|
|00000de0| 65 72 61 6c 2c 20 70 6c | 65 61 73 65 20 72 65 66 |eral, pl|ease ref|
|00000df0| 65 72 20 74 6f 20 74 68 | 65 20 6f 66 66 69 63 69 |er to th|e offici|
|00000e00| 61 6c 20 63 6f 6f 6b 69 | 65 0d 20 20 20 20 2f 2f |al cooki|e. //|
|00000e10| 20 20 73 70 65 63 2c 20 | 61 74 3a 0d 20 20 20 20 | spec, |at:. |
|00000e20| 2f 2f 0d 20 20 20 20 2f | 2f 20 20 20 20 20 20 68 |//. /|/ h|
|00000e30| 74 74 70 3a 2f 2f 77 77 | 77 2e 6e 65 74 73 63 61 |ttp://ww|w.netsca|
|00000e40| 70 65 2e 63 6f 6d 2f 6e | 65 77 73 72 65 66 2f 73 |pe.com/n|ewsref/s|
|00000e50| 74 64 2f 63 6f 6f 6b 69 | 65 5f 73 70 65 63 2e 68 |td/cooki|e_spec.h|
|00000e60| 74 6d 6c 20 20 20 20 0d | 20 20 20 20 2f 2f 0d 20 |tml .| //. |
|00000e70| 20 20 20 2f 2f 0d 20 20 | 20 20 2f 2f 20 22 49 6e | //. | // "In|
|00000e80| 74 65 72 6e 61 6c 22 20 | 66 75 6e 63 74 69 6f 6e |ternal" |function|
|00000e90| 20 74 6f 20 72 65 74 75 | 72 6e 20 74 68 65 20 64 | to retu|rn the d|
|00000ea0| 65 63 6f 64 65 64 20 76 | 61 6c 75 65 20 6f 66 20 |ecoded v|alue of |
|00000eb0| 61 20 63 6f 6f 6b 69 65 | 0d 20 20 20 20 2f 2f 0d |a cookie|. //.|
|00000ec0| 20 20 20 20 66 75 6e 63 | 74 69 6f 6e 20 67 65 74 | func|tion get|
|00000ed0| 43 6f 6f 6b 69 65 56 61 | 6c 20 28 6f 66 66 73 65 |CookieVa|l (offse|
|00000ee0| 74 29 20 7b 0d 20 20 20 | 20 20 20 76 61 72 20 65 |t) {. | var e|
|00000ef0| 6e 64 73 74 72 20 3d 20 | 64 6f 63 75 6d 65 6e 74 |ndstr = |document|
|00000f00| 2e 63 6f 6f 6b 69 65 2e | 69 6e 64 65 78 4f 66 20 |.cookie.|indexOf |
|00000f10| 28 22 3b 22 2c 20 6f 66 | 66 73 65 74 29 3b 0d 20 |(";", of|fset);. |
|00000f20| 20 20 20 20 20 69 66 20 | 28 65 6e 64 73 74 72 20 | if |(endstr |
|00000f30| 3d 3d 20 2d 31 29 0d 20 | 20 20 20 20 20 20 20 65 |== -1). | e|
|00000f40| 6e 64 73 74 72 20 3d 20 | 64 6f 63 75 6d 65 6e 74 |ndstr = |document|
|00000f50| 2e 63 6f 6f 6b 69 65 2e | 6c 65 6e 67 74 68 3b 0d |.cookie.|length;.|
|00000f60| 20 20 20 20 20 20 72 65 | 74 75 72 6e 20 75 6e 65 | re|turn une|
|00000f70| 73 63 61 70 65 28 64 6f | 63 75 6d 65 6e 74 2e 63 |scape(do|cument.c|
|00000f80| 6f 6f 6b 69 65 2e 73 75 | 62 73 74 72 69 6e 67 28 |ookie.su|bstring(|
|00000f90| 6f 66 66 73 65 74 2c 20 | 65 6e 64 73 74 72 29 29 |offset, |endstr))|
|00000fa0| 3b 0d 20 20 20 20 7d 0d | 0d 20 20 20 20 2f 2f 0d |;. }.|. //.|
|00000fb0| 20 20 20 20 2f 2f 20 20 | 46 75 6e 63 74 69 6f 6e | // |Function|
|00000fc0| 20 74 6f 20 72 65 74 75 | 72 6e 20 74 68 65 20 76 | to retu|rn the v|
|00000fd0| 61 6c 75 65 20 6f 66 20 | 74 68 65 20 63 6f 6f 6b |alue of |the cook|
|00000fe0| 69 65 20 73 70 65 63 69 | 66 69 65 64 20 62 79 20 |ie speci|fied by |
|00000ff0| 22 6e 61 6d 65 22 2e 0d | 20 20 20 20 2f 2f 20 20 |"name"..| // |
|00001000| 20 20 6e 61 6d 65 20 2d | 20 53 74 72 69 6e 67 20 | name -| String |
|00001010| 6f 62 6a 65 63 74 20 63 | 6f 6e 74 61 69 6e 69 6e |object c|ontainin|
|00001020| 67 20 74 68 65 20 63 6f | 6f 6b 69 65 20 6e 61 6d |g the co|okie nam|
|00001030| 65 2e 0d 20 20 20 20 2f | 2f 20 20 20 20 72 65 74 |e.. /|/ ret|
|00001040| 75 72 6e 73 20 2d 20 53 | 74 72 69 6e 67 20 6f 62 |urns - S|tring ob|
|00001050| 6a 65 63 74 20 63 6f 6e | 74 61 69 6e 69 6e 67 20 |ject con|taining |
|00001060| 74 68 65 20 63 6f 6f 6b | 69 65 20 76 61 6c 75 65 |the cook|ie value|
|00001070| 2c 20 6f 72 20 6e 75 6c | 6c 20 69 66 0d 20 20 20 |, or nul|l if. |
|00001080| 20 2f 2f 20 20 20 20 20 | 20 74 68 65 20 63 6f 6f | // | the coo|
|00001090| 6b 69 65 20 64 6f 65 73 | 20 6e 6f 74 20 65 78 69 |kie does| not exi|
|000010a0| 73 74 2e 0d 20 20 20 20 | 2f 2f 0d 20 20 20 20 66 |st.. |//. f|
|000010b0| 75 6e 63 74 69 6f 6e 20 | 47 65 74 43 6f 6f 6b 69 |unction |GetCooki|
|000010c0| 65 20 28 6e 61 6d 65 29 | 20 7b 0d 20 20 20 20 20 |e (name)| {. |
|000010d0| 20 76 61 72 20 61 72 67 | 20 3d 20 6e 61 6d 65 20 | var arg| = name |
|000010e0| 2b 20 22 3d 22 3b 0d 20 | 20 20 20 20 20 76 61 72 |+ "=";. | var|
|000010f0| 20 61 6c 65 6e 20 3d 20 | 61 72 67 2e 6c 65 6e 67 | alen = |arg.leng|
|00001100| 74 68 3b 0d 20 20 20 20 | 20 20 76 61 72 20 63 6c |th;. | var cl|
|00001110| 65 6e 20 3d 20 64 6f 63 | 75 6d 65 6e 74 2e 63 6f |en = doc|ument.co|
|00001120| 6f 6b 69 65 2e 6c 65 6e | 67 74 68 3b 0d 20 20 20 |okie.len|gth;. |
|00001130| 20 20 20 76 61 72 20 69 | 20 3d 20 30 3b 0d 20 20 | var i| = 0;. |
|00001140| 20 20 20 20 77 68 69 6c | 65 20 28 69 20 3c 20 63 | whil|e (i < c|
|00001150| 6c 65 6e 29 20 7b 0d 20 | 20 20 20 20 20 20 20 76 |len) {. | v|
|00001160| 61 72 20 6a 20 3d 20 69 | 20 2b 20 61 6c 65 6e 3b |ar j = i| + alen;|
|00001170| 0d 20 20 20 20 20 20 20 | 20 69 66 20 28 64 6f 63 |. | if (doc|
|00001180| 75 6d 65 6e 74 2e 63 6f | 6f 6b 69 65 2e 73 75 62 |ument.co|okie.sub|
|00001190| 73 74 72 69 6e 67 28 69 | 2c 20 6a 29 20 3d 3d 20 |string(i|, j) == |
|000011a0| 61 72 67 29 0d 20 20 20 | 20 20 20 20 20 20 20 72 |arg). | r|
|000011b0| 65 74 75 72 6e 20 67 65 | 74 43 6f 6f 6b 69 65 56 |eturn ge|tCookieV|
|000011c0| 61 6c 20 28 6a 29 3b 0d | 20 20 20 20 20 20 20 20 |al (j);.| |
|000011d0| 69 20 3d 20 64 6f 63 75 | 6d 65 6e 74 2e 63 6f 6f |i = docu|ment.coo|
|000011e0| 6b 69 65 2e 69 6e 64 65 | 78 4f 66 28 22 20 22 2c |kie.inde|xOf(" ",|
|000011f0| 20 69 29 20 2b 20 31 3b | 0d 20 20 20 20 20 20 20 | i) + 1;|. |
|00001200| 20 69 66 20 28 69 20 3d | 3d 20 30 29 20 62 72 65 | if (i =|= 0) bre|
|00001210| 61 6b 3b 20 0d 20 20 20 | 20 20 20 7d 0d 20 20 20 |ak; . | }. |
|00001220| 20 20 20 72 65 74 75 72 | 6e 20 6e 75 6c 6c 3b 0d | retur|n null;.|
|00001230| 20 20 20 20 7d 0d 0d 20 | 20 20 20 2f 2f 0d 20 20 | }.. | //. |
|00001240| 20 20 2f 2f 20 20 46 75 | 6e 63 74 69 6f 6e 20 74 | // Fu|nction t|
|00001250| 6f 20 63 72 65 61 74 65 | 20 6f 72 20 75 70 64 61 |o create| or upda|
|00001260| 74 65 20 61 20 63 6f 6f | 6b 69 65 2e 0d 20 20 20 |te a coo|kie.. |
|00001270| 20 2f 2f 20 20 20 20 6e | 61 6d 65 20 2d 20 53 74 | // n|ame - St|
|00001280| 72 69 6e 67 20 6f 62 6a | 65 63 74 20 6f 62 6a 65 |ring obj|ect obje|
|00001290| 63 74 20 63 6f 6e 74 61 | 69 6e 69 6e 67 20 74 68 |ct conta|ining th|
|000012a0| 65 20 63 6f 6f 6b 69 65 | 20 6e 61 6d 65 2e 0d 20 |e cookie| name.. |
|000012b0| 20 20 20 2f 2f 20 20 20 | 20 76 61 6c 75 65 20 2d | // | value -|
|000012c0| 20 53 74 72 69 6e 67 20 | 6f 62 6a 65 63 74 20 63 | String |object c|
|000012d0| 6f 6e 74 61 69 6e 69 6e | 67 20 74 68 65 20 63 6f |ontainin|g the co|
|000012e0| 6f 6b 69 65 20 76 61 6c | 75 65 2e 20 20 4d 61 79 |okie val|ue. May|
|000012f0| 20 63 6f 6e 74 61 69 6e | 0d 20 20 20 20 2f 2f 20 | contain|. // |
|00001300| 20 20 20 20 20 61 6e 79 | 20 76 61 6c 69 64 20 73 | any| valid s|
|00001310| 74 72 69 6e 67 20 63 68 | 61 72 61 63 74 65 72 73 |tring ch|aracters|
|00001320| 2e 0d 20 20 20 20 2f 2f | 20 20 20 20 5b 65 78 70 |.. //| [exp|
|00001330| 69 72 65 73 5d 20 2d 20 | 44 61 74 65 20 6f 62 6a |ires] - |Date obj|
|00001340| 65 63 74 20 63 6f 6e 74 | 61 69 6e 69 6e 67 20 74 |ect cont|aining t|
|00001350| 68 65 20 65 78 70 69 72 | 61 74 69 6f 6e 20 64 61 |he expir|ation da|
|00001360| 74 61 20 6f 66 20 74 68 | 65 20 63 6f 6f 6b 69 65 |ta of th|e cookie|
|00001370| 2e 20 20 49 66 0d 20 20 | 20 20 2f 2f 20 20 20 20 |. If. | // |
|00001380| 20 20 6f 6d 69 74 74 65 | 64 20 6f 72 20 6e 75 6c | omitte|d or nul|
|00001390| 6c 2c 20 65 78 70 69 72 | 65 73 20 74 68 65 20 63 |l, expir|es the c|
|000013a0| 6f 6f 6b 69 65 20 61 74 | 20 74 68 65 20 65 6e 64 |ookie at| the end|
|000013b0| 20 6f 66 20 74 68 65 20 | 63 75 72 72 65 6e 74 20 | of the |current |
|000013c0| 73 65 73 73 69 6f 6e 2e | 0d 20 20 20 20 2f 2f 20 |session.|. // |
|000013d0| 20 20 20 5b 70 61 74 68 | 5d 20 2d 20 53 74 72 69 | [path|] - Stri|
|000013e0| 6e 67 20 6f 62 6a 65 63 | 74 20 69 6e 64 69 63 61 |ng objec|t indica|
|000013f0| 74 69 6e 67 20 74 68 65 | 20 70 61 74 68 20 66 6f |ting the| path fo|
|00001400| 72 20 77 68 69 63 68 20 | 74 68 65 20 63 6f 6f 6b |r which |the cook|
|00001410| 69 65 20 69 73 20 76 61 | 6c 69 64 2e 0d 20 20 20 |ie is va|lid.. |
|00001420| 20 2f 2f 20 20 20 20 20 | 20 49 66 20 6f 6d 69 74 | // | If omit|
|00001430| 74 65 64 20 6f 72 20 6e | 75 6c 6c 2c 20 75 73 65 |ted or n|ull, use|
|00001440| 73 20 74 68 65 20 70 61 | 74 68 20 6f 66 20 74 68 |s the pa|th of th|
|00001450| 65 20 63 61 6c 6c 69 6e | 67 20 64 6f 63 75 6d 65 |e callin|g docume|
|00001460| 6e 74 2e 0d 20 20 20 20 | 2f 2f 20 20 20 20 5b 64 |nt.. |// [d|
|00001470| 6f 6d 61 69 6e 5d 20 2d | 20 53 74 72 69 6e 67 20 |omain] -| String |
|00001480| 6f 62 6a 65 63 74 20 69 | 6e 64 69 63 61 74 69 6e |object i|ndicatin|
|00001490| 67 20 74 68 65 20 64 6f | 6d 61 69 6e 20 66 6f 72 |g the do|main for|
|000014a0| 20 77 68 69 63 68 20 74 | 68 65 20 63 6f 6f 6b 69 | which t|he cooki|
|000014b0| 65 20 69 73 0d 20 20 20 | 20 2f 2f 20 20 20 20 20 |e is. | // |
|000014c0| 20 76 61 6c 69 64 2e 20 | 20 49 66 20 6f 6d 69 74 | valid. | If omit|
|000014d0| 74 65 64 20 6f 72 20 6e | 75 6c 6c 2c 20 75 73 65 |ted or n|ull, use|
|000014e0| 73 20 74 68 65 20 64 6f | 6d 61 69 6e 20 6f 66 20 |s the do|main of |
|000014f0| 74 68 65 20 63 61 6c 6c | 69 6e 67 20 64 6f 63 75 |the call|ing docu|
|00001500| 6d 65 6e 74 2e 0d 20 20 | 20 20 2f 2f 20 20 20 20 |ment.. | // |
|00001510| 5b 73 65 63 75 72 65 5d | 20 2d 20 42 6f 6f 6c 65 |[secure]| - Boole|
|00001520| 61 6e 20 28 74 72 75 65 | 2f 66 61 6c 73 65 29 20 |an (true|/false) |
|00001530| 76 61 6c 75 65 20 69 6e | 64 69 63 61 74 69 6e 67 |value in|dicating|
|00001540| 20 77 68 65 74 68 65 72 | 20 63 6f 6f 6b 69 65 20 | whether| cookie |
|00001550| 74 72 61 6e 73 6d 69 73 | 73 69 6f 6e 0d 20 20 20 |transmis|sion. |
|00001560| 20 2f 2f 20 20 20 20 20 | 20 72 65 71 75 69 72 65 | // | require|
|00001570| 73 20 61 20 73 65 63 75 | 72 65 20 63 68 61 6e 6e |s a secu|re chann|
|00001580| 65 6c 20 28 48 54 54 50 | 53 29 2e 20 20 0d 20 20 |el (HTTP|S). . |
|00001590| 20 20 2f 2f 0d 20 20 20 | 20 2f 2f 20 20 54 68 65 | //. | // The|
|000015a0| 20 66 69 72 73 74 20 74 | 77 6f 20 70 61 72 61 6d | first t|wo param|
|000015b0| 65 74 65 72 73 20 61 72 | 65 20 72 65 71 75 69 72 |eters ar|e requir|
|000015c0| 65 64 2e 20 20 54 68 65 | 20 6f 74 68 65 72 73 2c |ed. The| others,|
|000015d0| 20 69 66 20 73 75 70 70 | 6c 69 65 64 2c 20 6d 75 | if supp|lied, mu|
|000015e0| 73 74 0d 20 20 20 20 2f | 2f 20 20 62 65 20 70 61 |st. /|/ be pa|
|000015f0| 73 73 65 64 20 69 6e 20 | 74 68 65 20 6f 72 64 65 |ssed in |the orde|
|00001600| 72 20 6c 69 73 74 65 64 | 20 61 62 6f 76 65 2e 20 |r listed| above. |
|00001610| 20 54 6f 20 6f 6d 69 74 | 20 61 6e 20 75 6e 75 73 | To omit| an unus|
|00001620| 65 64 20 6f 70 74 69 6f | 6e 61 6c 20 66 69 65 6c |ed optio|nal fiel|
|00001630| 64 2c 0d 20 20 20 20 2f | 2f 20 20 75 73 65 20 6e |d,. /|/ use n|
|00001640| 75 6c 6c 20 61 73 20 61 | 20 70 6c 61 63 65 20 68 |ull as a| place h|
|00001650| 6f 6c 64 65 72 2e 20 20 | 46 6f 72 20 65 78 61 6d |older. |For exam|
|00001660| 70 6c 65 2c 20 74 6f 20 | 63 61 6c 6c 20 53 65 74 |ple, to |call Set|
|00001670| 43 6f 6f 6b 69 65 20 75 | 73 69 6e 67 20 6e 61 6d |Cookie u|sing nam|
|00001680| 65 2c 0d 20 20 20 20 2f | 2f 20 20 76 61 6c 75 65 |e,. /|/ value|
|00001690| 20 61 6e 64 20 70 61 74 | 68 2c 20 79 6f 75 20 77 | and pat|h, you w|
|000016a0| 6f 75 6c 64 20 63 6f 64 | 65 3a 0d 20 20 20 20 2f |ould cod|e:. /|
|000016b0| 2f 0d 20 20 20 20 2f 2f | 20 20 20 20 20 20 53 65 |/. //| Se|
|000016c0| 74 43 6f 6f 6b 69 65 20 | 28 22 6d 79 43 6f 6f 6b |tCookie |("myCook|
|000016d0| 69 65 4e 61 6d 65 22 2c | 20 22 6d 79 43 6f 6f 6b |ieName",| "myCook|
|000016e0| 69 65 56 61 6c 75 65 22 | 2c 20 6e 75 6c 6c 2c 20 |ieValue"|, null, |
|000016f0| 22 2f 22 29 3b 0d 20 20 | 20 20 2f 2f 0d 20 20 20 |"/");. | //. |
|00001700| 20 2f 2f 20 20 4e 6f 74 | 65 20 74 68 61 74 20 74 | // Not|e that t|
|00001710| 72 61 69 6c 69 6e 67 20 | 6f 6d 69 74 74 65 64 20 |railing |omitted |
|00001720| 70 61 72 61 6d 65 74 65 | 72 73 20 64 6f 20 6e 6f |paramete|rs do no|
|00001730| 74 20 72 65 71 75 69 72 | 65 20 61 20 70 6c 61 63 |t requir|e a plac|
|00001740| 65 68 6f 6c 64 65 72 2e | 0d 20 20 20 20 2f 2f 0d |eholder.|. //.|
|00001750| 20 20 20 20 2f 2f 20 20 | 54 6f 20 73 65 74 20 61 | // |To set a|
|00001760| 20 73 65 63 75 72 65 20 | 63 6f 6f 6b 69 65 20 66 | secure |cookie f|
|00001770| 6f 72 20 70 61 74 68 20 | 22 2f 6d 79 50 61 74 68 |or path |"/myPath|
|00001780| 22 2c 20 74 68 61 74 20 | 65 78 70 69 72 65 73 20 |", that |expires |
|00001790| 61 66 74 65 72 20 74 68 | 65 0d 20 20 20 20 2f 2f |after th|e. //|
|000017a0| 20 20 63 75 72 72 65 6e | 74 20 73 65 73 73 69 6f | curren|t sessio|
|000017b0| 6e 2c 20 79 6f 75 20 6d | 69 67 68 74 20 63 6f 64 |n, you m|ight cod|
|000017c0| 65 3a 0d 20 20 20 20 2f | 2f 0d 20 20 20 20 2f 2f |e:. /|/. //|
|000017d0| 20 20 20 20 20 20 53 65 | 74 43 6f 6f 6b 69 65 20 | Se|tCookie |
|000017e0| 28 6d 79 43 6f 6f 6b 69 | 65 56 61 72 2c 20 63 6f |(myCooki|eVar, co|
|000017f0| 6f 6b 69 65 56 61 6c 75 | 65 56 61 72 2c 20 6e 75 |okieValu|eVar, nu|
|00001800| 6c 6c 2c 20 22 2f 6d 79 | 50 61 74 68 22 2c 20 6e |ll, "/my|Path", n|
|00001810| 75 6c 6c 2c 20 74 72 75 | 65 29 3b 0d 20 20 20 20 |ull, tru|e);. |
|00001820| 2f 2f 0d 20 20 20 20 66 | 75 6e 63 74 69 6f 6e 20 |//. f|unction |
|00001830| 53 65 74 43 6f 6f 6b 69 | 65 20 28 6e 61 6d 65 2c |SetCooki|e (name,|
|00001840| 20 76 61 6c 75 65 29 20 | 7b 0d 20 20 20 20 20 20 | value) |{. |
|00001850| 76 61 72 20 61 72 67 76 | 20 3d 20 53 65 74 43 6f |var argv| = SetCo|
|00001860| 6f 6b 69 65 2e 61 72 67 | 75 6d 65 6e 74 73 3b 0d |okie.arg|uments;.|
|00001870| 20 20 20 20 20 20 76 61 | 72 20 61 72 67 63 20 3d | va|r argc =|
|00001880| 20 53 65 74 43 6f 6f 6b | 69 65 2e 61 72 67 75 6d | SetCook|ie.argum|
|00001890| 65 6e 74 73 2e 6c 65 6e | 67 74 68 3b 0d 20 20 20 |ents.len|gth;. |
|000018a0| 20 20 20 76 61 72 20 65 | 78 70 69 72 65 73 20 3d | var e|xpires =|
|000018b0| 20 28 61 72 67 63 20 3e | 20 32 29 20 3f 20 61 72 | (argc >| 2) ? ar|
|000018c0| 67 76 5b 32 5d 20 3a 20 | 6e 75 6c 6c 3b 0d 20 20 |gv[2] : |null;. |
|000018d0| 20 20 20 20 76 61 72 20 | 70 61 74 68 20 3d 20 28 | var |path = (|
|000018e0| 61 72 67 63 20 3e 20 33 | 29 20 3f 20 61 72 67 76 |argc > 3|) ? argv|
|000018f0| 5b 33 5d 20 3a 20 6e 75 | 6c 6c 3b 0d 20 20 20 20 |[3] : nu|ll;. |
|00001900| 20 20 76 61 72 20 64 6f | 6d 61 69 6e 20 3d 20 28 | var do|main = (|
|00001910| 61 72 67 63 20 3e 20 34 | 29 20 3f 20 61 72 67 76 |argc > 4|) ? argv|
|00001920| 5b 34 5d 20 3a 20 6e 75 | 6c 6c 3b 0d 20 20 20 20 |[4] : nu|ll;. |
|00001930| 20 20 76 61 72 20 73 65 | 63 75 72 65 20 3d 20 28 | var se|cure = (|
|00001940| 61 72 67 63 20 3e 20 35 | 29 20 3f 20 61 72 67 76 |argc > 5|) ? argv|
|00001950| 5b 35 5d 20 3a 20 66 61 | 6c 73 65 3b 0d 20 20 20 |[5] : fa|lse;. |
|00001960| 20 20 20 64 6f 63 75 6d | 65 6e 74 2e 63 6f 6f 6b | docum|ent.cook|
|00001970| 69 65 20 3d 20 6e 61 6d | 65 20 2b 20 22 3d 22 20 |ie = nam|e + "=" |
|00001980| 2b 20 65 73 63 61 70 65 | 20 28 76 61 6c 75 65 29 |+ escape| (value)|
|00001990| 20 2b 0d 20 20 20 20 20 | 20 20 20 28 28 65 78 70 | +. | ((exp|
|000019a0| 69 72 65 73 20 3d 3d 20 | 6e 75 6c 6c 29 20 3f 20 |ires == |null) ? |
|000019b0| 22 22 20 3a 20 28 22 3b | 20 65 78 70 69 72 65 73 |"" : (";| expires|
|000019c0| 3d 22 20 2b 20 65 78 70 | 69 72 65 73 2e 74 6f 47 |=" + exp|ires.toG|
|000019d0| 4d 54 53 74 72 69 6e 67 | 28 29 29 29 20 2b 0d 20 |MTString|())) +. |
|000019e0| 20 20 20 20 20 20 20 28 | 28 70 61 74 68 20 3d 3d | (|(path ==|
|000019f0| 20 6e 75 6c 6c 29 20 3f | 20 22 22 20 3a 20 28 22 | null) ?| "" : ("|
|00001a00| 3b 20 70 61 74 68 3d 22 | 20 2b 20 70 61 74 68 29 |; path="| + path)|
|00001a10| 29 20 2b 0d 20 20 20 20 | 20 20 20 20 28 28 64 6f |) +. | ((do|
|00001a20| 6d 61 69 6e 20 3d 3d 20 | 6e 75 6c 6c 29 20 3f 20 |main == |null) ? |
|00001a30| 22 22 20 3a 20 28 22 3b | 20 64 6f 6d 61 69 6e 3d |"" : (";| domain=|
|00001a40| 22 20 2b 20 64 6f 6d 61 | 69 6e 29 29 20 2b 0d 20 |" + doma|in)) +. |
|00001a50| 20 20 20 20 20 20 20 28 | 28 73 65 63 75 72 65 20 | (|(secure |
|00001a60| 3d 3d 20 74 72 75 65 29 | 20 3f 20 22 3b 20 73 65 |== true)| ? "; se|
|00001a70| 63 75 72 65 22 20 3a 20 | 22 22 29 3b 0d 20 20 20 |cure" : |"");. |
|00001a80| 20 7d 0d 0d 20 20 20 20 | 2f 2f 20 20 46 75 6e 63 | }.. |// Func|
|00001a90| 74 69 6f 6e 20 74 6f 20 | 64 65 6c 65 74 65 20 61 |tion to |delete a|
|00001aa0| 20 63 6f 6f 6b 69 65 2e | 20 28 53 65 74 73 20 65 | cookie.| (Sets e|
|00001ab0| 78 70 69 72 61 74 69 6f | 6e 20 64 61 74 65 20 74 |xpiratio|n date t|
|00001ac0| 6f 20 63 75 72 72 65 6e | 74 20 64 61 74 65 2f 74 |o curren|t date/t|
|00001ad0| 69 6d 65 29 0d 20 20 20 | 20 2f 2f 20 20 20 20 6e |ime). | // n|
|00001ae0| 61 6d 65 20 2d 20 53 74 | 72 69 6e 67 20 6f 62 6a |ame - St|ring obj|
|00001af0| 65 63 74 20 63 6f 6e 74 | 61 69 6e 69 6e 67 20 74 |ect cont|aining t|
|00001b00| 68 65 20 63 6f 6f 6b 69 | 65 20 6e 61 6d 65 0d 20 |he cooki|e name. |
|00001b10| 20 20 20 2f 2f 0d 20 20 | 20 20 66 75 6e 63 74 69 | //. | functi|
|00001b20| 6f 6e 20 44 65 6c 65 74 | 65 43 6f 6f 6b 69 65 20 |on Delet|eCookie |
|00001b30| 28 6e 61 6d 65 29 20 7b | 0d 20 20 20 20 20 20 76 |(name) {|. v|
|00001b40| 61 72 20 65 78 70 20 3d | 20 6e 65 77 20 44 61 74 |ar exp =| new Dat|
|00001b50| 65 28 29 3b 0d 20 20 20 | 20 20 20 65 78 70 2e 73 |e();. | exp.s|
|00001b60| 65 74 54 69 6d 65 20 28 | 65 78 70 2e 67 65 74 54 |etTime (|exp.getT|
|00001b70| 69 6d 65 28 29 20 2d 20 | 31 29 3b 20 20 2f 2f 20 |ime() - |1); // |
|00001b80| 54 68 69 73 20 63 6f 6f | 6b 69 65 20 69 73 20 68 |This coo|kie is h|
|00001b90| 69 73 74 6f 72 79 0d 20 | 20 20 20 20 20 76 61 72 |istory. | var|
|00001ba0| 20 63 76 61 6c 20 3d 20 | 47 65 74 43 6f 6f 6b 69 | cval = |GetCooki|
|00001bb0| 65 20 28 6e 61 6d 65 29 | 3b 0d 20 20 20 20 20 20 |e (name)|;. |
|00001bc0| 64 6f 63 75 6d 65 6e 74 | 2e 63 6f 6f 6b 69 65 20 |document|.cookie |
|00001bd0| 3d 20 6e 61 6d 65 20 2b | 20 22 3d 22 20 2b 20 63 |= name +| "=" + c|
|00001be0| 76 61 6c 20 2b 20 22 3b | 20 65 78 70 69 72 65 73 |val + ";| expires|
|00001bf0| 3d 22 20 2b 20 65 78 70 | 2e 74 6f 47 4d 54 53 74 |=" + exp|.toGMTSt|
|00001c00| 72 69 6e 67 28 29 3b 0d | 20 20 20 20 7d 0d 0d 2f |ring();.| }../|
|00001c10| 2f 20 2d 2d 3e 0d 3c 2f | 73 63 72 69 70 74 3e 0d |/ -->.</|script>.|
|00001c20| 0d 3c 2f 68 65 61 64 3e | 0d 0d 3c 62 6f 64 79 20 |.</head>|..<body |
|00001c30| 62 67 63 6f 6c 6f 72 3d | 22 46 46 46 46 46 46 22 |bgcolor=|"FFFFFF"|
|00001c40| 20 74 65 78 74 3d 22 30 | 30 30 30 30 30 22 3e 0d | text="0|00000">.|
|00001c50| 0d 3c 68 31 3e 4a 61 76 | 61 53 63 72 69 70 74 20 |.<h1>Jav|aScript |
|00001c60| 43 6f 6f 6b 69 65 73 20 | 45 78 61 6d 70 6c 65 3c |Cookies |Example<|
|00001c70| 2f 68 31 3e 0d 0d 3c 70 | 3e 3c 62 3e 54 68 69 73 |/h1>..<p|><b>This|
|00001c80| 20 70 61 67 65 20 63 6f | 6e 74 61 69 6e 73 20 61 | page co|ntains a|
|00001c90| 20 4a 61 76 61 53 63 72 | 69 70 74 20 74 68 61 74 | JavaScr|ipt that|
|00001ca0| 20 73 74 6f 72 65 73 20 | 69 6e 66 6f 72 6d 61 74 | stores |informat|
|00001cb0| 69 6f 6e 20 61 62 6f 75 | 74 20 74 68 65 20 6c 61 |ion abou|t the la|
|00001cc0| 73 74 20 74 69 6d 65 20 | 61 20 72 65 61 64 65 72 |st time |a reader|
|00001cd0| 20 76 69 73 69 74 65 64 | 20 74 68 65 20 70 61 67 | visited| the pag|
|00001ce0| 65 3c 2f 62 3e 3c 2f 70 | 3e 0d 3c 70 3e 0d 54 68 |e</b></p|>.<p>.Th|
|00001cf0| 65 73 65 20 4a 61 76 61 | 53 63 72 69 70 74 73 20 |ese Java|Scripts |
|00001d00| 75 73 65 20 50 65 72 73 | 69 73 74 65 6e 74 20 43 |use Pers|istent C|
|00001d10| 6c 69 65 6e 74 20 53 74 | 61 74 65 20 48 54 54 50 |lient St|ate HTTP|
|00001d20| 20 43 6f 6f 6b 69 65 73 | 20 74 6f 20 73 74 6f 72 | Cookies| to stor|
|00001d30| 65 20 69 6e 66 6f 72 6d | 61 74 69 6f 6e 20 61 62 |e inform|ation ab|
|00001d40| 6f 75 74 20 74 68 65 20 | 6c 61 73 74 20 74 69 6d |out the |last tim|
|00001d50| 65 20 61 20 72 65 61 64 | 65 72 20 76 69 73 69 74 |e a read|er visit|
|00001d60| 65 64 20 74 68 65 20 70 | 61 67 65 2e 20 41 20 63 |ed the p|age. A c|
|00001d70| 6f 6f 6b 69 65 20 69 73 | 20 61 20 6d 65 63 68 61 |ookie is| a mecha|
|00001d80| 6e 69 73 6d 20 74 68 61 | 74 20 61 6c 6c 6f 77 73 |nism tha|t allows|
|00001d90| 20 69 6e 66 6f 72 6d 61 | 74 69 6f 6e 20 74 6f 20 | informa|tion to |
|00001da0| 62 65 20 73 74 6f 72 65 | 64 20 61 63 72 6f 73 73 |be store|d across|
|00001db0| 20 6d 75 6c 74 69 70 6c | 65 20 73 65 73 73 69 6f | multipl|e sessio|
|00001dc0| 6e 73 2e 3c 2f 70 3e 0d | 3c 70 3e 0d 49 6e 20 74 |ns.</p>.|<p>.In t|
|00001dd0| 68 69 73 20 65 78 61 6d | 70 6c 65 20 74 77 6f 20 |his exam|ple two |
|00001de0| 63 6f 6f 6b 69 65 73 20 | 61 72 65 20 73 74 6f 72 |cookies |are stor|
|00001df0| 65 64 20 63 6f 6e 74 61 | 69 6e 69 6e 67 20 69 6e |ed conta|ining in|
|00001e00| 66 6f 72 6d 61 74 69 6f | 6e 20 61 62 6f 75 74 20 |formatio|n about |
|00001e10| 6c 61 73 74 20 64 61 74 | 65 20 61 6e 64 20 6e 75 |last dat|e and nu|
|00001e20| 6d 62 65 72 20 6f 66 20 | 74 69 6d 65 73 20 74 68 |mber of |times th|
|00001e30| 65 20 72 65 61 64 65 72 | 20 68 61 73 20 76 69 73 |e reader| has vis|
|00001e40| 69 74 65 64 20 61 20 70 | 61 67 65 20 28 63 6f 6e |ited a p|age (con|
|00001e50| 74 61 69 6e 69 6e 67 20 | 74 68 65 73 65 20 63 6f |taining |these co|
|00001e60| 6f 6b 69 65 73 29 2e 20 | 53 69 6e 63 65 20 74 68 |okies). |Since th|
|00001e70| 65 20 63 6f 6f 6b 69 65 | 73 20 61 72 65 20 73 74 |e cookie|s are st|
|00001e80| 6f 72 65 64 20 6f 6e 20 | 74 68 65 20 72 65 61 64 |ored on |the read|
|00001e90| 65 72 73 20 68 61 72 64 | 20 64 69 73 6b 20 79 6f |ers hard| disk yo|
|00001ea0| 75 20 2d 20 74 68 65 20 | 61 75 74 68 6f 72 20 2d |u - the |author -|
|00001eb0| 20 77 69 6c 6c 20 6e 6f | 74 20 62 65 20 61 62 6c | will no|t be abl|
|00001ec0| 65 20 74 6f 20 65 78 74 | 72 61 63 74 20 69 6e 66 |e to ext|ract inf|
|00001ed0| 6f 72 6d 61 74 69 6f 6e | 20 61 62 6f 75 74 20 74 |ormation| about t|
|00001ee0| 68 65 20 72 65 61 64 65 | 72 2e 3c 2f 70 3e 0d 3c |he reade|r.</p>.<|
|00001ef0| 70 3e 0d 43 6f 6f 6b 69 | 65 73 20 63 61 6e 20 61 |p>.Cooki|es can a|
|00001f00| 6c 73 6f 20 62 65 20 75 | 73 65 64 20 66 6f 72 20 |lso be u|sed for |
|00001f10| 6d 61 6e 79 20 6f 74 68 | 65 72 20 70 75 72 70 6f |many oth|er purpo|
|00001f20| 73 65 73 2c 20 73 75 63 | 68 20 61 73 20 6b 65 65 |ses, suc|h as kee|
|00001f30| 70 69 6e 67 20 72 65 61 | 64 65 72 73 20 70 72 65 |ping rea|ders pre|
|00001f40| 66 65 72 65 6e 63 65 73 | 20 66 6f 72 20 76 69 65 |ferences| for vie|
|00001f50| 77 69 6e 67 20 61 20 73 | 69 74 65 2c 20 73 74 6f |wing a s|ite, sto|
|00001f60| 72 69 6e 67 20 70 61 73 | 73 77 6f 72 64 73 2c 20 |ring pas|swords, |
|00001f70| 69 6d 70 6c 65 6d 65 6e | 74 69 6e 67 20 61 20 73 |implemen|ting a s|
|00001f80| 68 6f 70 70 69 6e 67 20 | 63 61 72 74 20 66 6f 72 |hopping |cart for|
|00001f90| 20 6f 6e 6c 69 6e 65 20 | 62 75 73 69 6e 65 73 73 | online |business|
|00001fa0| 20 6f 72 20 66 6f 72 20 | 6b 65 65 70 69 6e 67 20 | or for |keeping |
|00001fb0| 74 72 61 63 6b 20 6f 66 | 20 61 63 63 65 73 73 20 |track of| access |
|00001fc0| 72 69 67 68 74 73 20 66 | 6f 72 20 61 20 73 70 65 |rights f|or a spe|
|00001fd0| 63 69 66 69 63 20 72 65 | 61 64 65 72 20 76 69 65 |cific re|ader vie|
|00001fe0| 77 69 6e 67 20 70 61 67 | 65 73 20 63 72 65 61 74 |wing pag|es creat|
|00001ff0| 65 64 20 6f 6e 20 74 68 | 65 20 66 6c 79 20 6f 6e |ed on th|e fly on|
|00002000| 20 74 68 65 20 73 65 72 | 76 65 72 2e 3c 2f 70 3e | the ser|ver.</p>|
|00002010| 0d 0d 3c 68 72 3e 0d 3c | 70 3e 3c 62 3e 48 65 72 |..<hr>.<|p><b>Her|
|00002020| 65 20 69 73 20 61 6e 20 | 65 78 61 6d 70 6c 65 3a |e is an |example:|
|00002030| 3c 2f 62 3e 3c 2f 70 3e | 0d 0d 3c 70 3e 0d 48 65 |</b></p>|..<p>.He|
|00002040| 6c 6c 6f 2c 20 3c 73 63 | 72 69 70 74 20 6c 61 6e |llo, <sc|ript lan|
|00002050| 67 75 61 67 65 3d 22 4a | 61 76 61 53 63 72 69 70 |guage="J|avaScrip|
|00002060| 74 22 20 20 74 79 70 65 | 3d 22 74 65 78 74 2f 6a |t" type|="text/j|
|00002070| 61 76 61 73 63 72 69 70 | 74 22 3e 64 6f 63 75 6d |avascrip|t">docum|
|00002080| 65 6e 74 2e 77 72 69 74 | 65 28 6e 61 76 69 67 61 |ent.writ|e(naviga|
|00002090| 74 6f 72 2e 75 73 65 72 | 41 67 65 6e 74 29 3b 3c |tor.user|Agent);<|
|000020a0| 2f 53 43 52 49 50 54 3e | 21 3c 2f 70 3e 0d 0d 3c |/SCRIPT>|!</p>..<|
|000020b0| 70 3e 0d 3c 73 63 72 69 | 70 74 20 6c 61 6e 67 75 |p>.<scri|pt langu|
|000020c0| 61 67 65 3d 22 4a 61 76 | 61 53 63 72 69 70 74 22 |age="Jav|aScript"|
|000020d0| 20 20 74 79 70 65 3d 22 | 74 65 78 74 2f 6a 61 76 | type="|text/jav|
|000020e0| 61 73 63 72 69 70 74 22 | 3e 64 6f 63 75 6d 65 6e |ascript"|>documen|
|000020f0| 74 2e 77 72 69 74 65 20 | 28 47 65 74 4c 61 73 74 |t.write |(GetLast|
|00002100| 56 69 73 69 74 28 29 29 | 3c 2f 73 63 72 69 70 74 |Visit())|</script|
|00002110| 3e 3c 2f 70 3e 0d 0d 3c | 70 3e 0d 52 65 6c 6f 61 |></p>..<|p>.Reloa|
|00002120| 64 20 74 68 69 73 20 70 | 61 67 65 20 74 6f 20 73 |d this p|age to s|
|00002130| 65 65 20 74 68 65 20 74 | 65 78 74 20 61 62 6f 76 |ee the t|ext abov|
|00002140| 65 20 75 70 64 61 74 65 | 64 2e 3c 2f 70 3e 0d 0d |e update|d.</p>..|
|00002150| 0d 3c 68 72 3e 0d 3c 70 | 3e 3c 62 3e 48 6f 77 20 |.<hr>.<p|><b>How |
|00002160| 74 6f 20 75 73 65 3a 3c | 2f 62 3e 3c 2f 70 3e 0d |to use:<|/b></p>.|
|00002170| 3c 70 3e 52 65 6e 61 6d | 65 20 74 68 65 20 63 6f |<p>Renam|e the co|
|00002180| 6e 73 74 61 6e 74 73 20 | 3c 63 6f 64 65 3e 27 6d |nstants |<code>'m|
|00002190| 79 5f 4c 61 73 74 56 69 | 73 69 74 27 3c 2f 63 6f |y_LastVi|sit'</co|
|000021a0| 64 65 3e 20 61 6e 64 20 | 27 3c 63 6f 64 65 3e 6d |de> and |'<code>m|
|000021b0| 79 5f 4e 75 6d 56 69 73 | 69 74 73 27 3c 2f 63 6f |y_NumVis|its'</co|
|000021c0| 64 65 3e 20 74 6f 20 73 | 6f 6d 65 74 68 69 6e 67 |de> to s|omething|
|000021d0| 20 75 6e 69 71 75 65 20 | 66 6f 72 20 74 68 65 20 | unique |for the |
|000021e0| 63 75 72 72 65 6e 74 20 | 70 61 67 65 20 28 6d 61 |current |page (ma|
|000021f0| 79 62 65 20 75 73 65 20 | 73 6f 6d 65 20 70 61 72 |ybe use |some par|
|00002200| 74 20 6f 74 20 74 68 65 | 20 75 72 6c 29 20 6f 72 |t ot the| url) or|
|00002210| 20 65 6c 73 65 20 69 74 | 20 77 6f 6e 27 74 20 77 | else it| won't w|
|00002220| 6f 72 6b 20 63 6f 72 72 | 65 63 74 6c 79 20 69 66 |ork corr|ectly if|
|00002230| 20 6f 74 68 65 72 20 75 | 73 65 73 20 74 68 69 73 | other u|ses this|
|00002240| 20 73 63 72 69 70 74 21 | 20 54 68 65 73 65 20 63 | script!| These c|
|00002250| 6f 6e 73 74 61 6e 74 73 | 20 61 72 65 20 6c 6f 63 |onstants| are loc|
|00002260| 61 74 65 64 20 61 74 20 | 74 68 65 20 62 65 67 69 |ated at |the begi|
|00002270| 6e 6e 69 6e 67 20 6f 66 | 20 74 68 65 20 48 45 41 |nning of| the HEA|
|00002280| 44 20 73 65 63 74 69 6f | 6e 20 69 6e 20 74 68 69 |D sectio|n in thi|
|00002290| 73 20 66 69 6c 65 2e 20 | 49 74 20 69 73 20 69 6d |s file. |It is im|
|000022a0| 70 6f 72 74 61 6e 74 20 | 74 6f 20 64 6f 20 74 68 |portant |to do th|
|000022b0| 69 73 21 3c 2f 70 3e 0d | 0d 3c 70 3e 0d 59 6f 75 |is!</p>.|.<p>.You|
|000022c0| 20 6d 61 79 20 77 61 6e | 74 20 74 6f 20 63 68 61 | may wan|t to cha|
|000022d0| 6e 67 65 20 74 68 65 20 | 74 65 78 74 20 69 6e 73 |nge the |text ins|
|000022e0| 69 64 65 20 66 75 6e 63 | 74 69 6f 6e 20 3c 63 6f |ide func|tion <co|
|000022f0| 64 65 3e 47 65 74 4c 61 | 73 74 56 69 73 69 74 28 |de>GetLa|stVisit(|
|00002300| 29 3c 2f 63 6f 64 65 3e | 20 74 6f 20 73 6f 6d 65 |)</code>| to some|
|00002310| 74 68 69 6e 67 20 6d 6f | 72 65 20 61 70 70 72 6f |thing mo|re appro|
|00002320| 70 72 69 61 74 65 20 66 | 6f 72 20 79 6f 75 72 20 |priate f|or your |
|00002330| 20 73 69 74 65 2e 3c 2f | 70 3e 0d 0d 3c 70 3e 0d | site.</|p>..<p>.|
|00002340| 46 69 6e 61 6c 6c 79 20 | 75 73 65 20 74 68 69 73 |Finally |use this|
|00002350| 20 63 6f 64 65 20 69 6e | 73 69 64 65 20 74 68 65 | code in|side the|
|00002360| 20 42 4f 44 59 20 73 65 | 63 74 69 6f 6e 20 74 6f | BODY se|ction to|
|00002370| 20 64 69 73 70 6c 61 79 | 20 74 68 65 20 69 6e 66 | display| the inf|
|00002380| 6f 72 6d 61 74 69 6f 6e | 20 69 6e 20 74 68 65 20 |ormation| in the |
|00002390| 62 72 6f 77 73 65 72 3a | 0d 3c 70 72 65 3e 26 6c |browser:|.<pre>&l|
|000023a0| 74 3b 53 43 52 49 50 54 | 20 4c 41 4e 47 55 41 47 |t;SCRIPT| LANGUAG|
|000023b0| 45 3d 22 4a 61 76 61 53 | 63 72 69 70 74 22 26 67 |E="JavaS|cript"&g|
|000023c0| 74 3b 64 6f 63 75 6d 65 | 6e 74 2e 77 72 69 74 65 |t;docume|nt.write|
|000023d0| 20 28 47 65 74 4c 61 73 | 74 56 69 73 69 74 28 29 | (GetLas|tVisit()|
|000023e0| 29 26 6c 74 3b 2f 53 43 | 52 49 50 54 26 67 74 3b |)&lt;/SC|RIPT&gt;|
|000023f0| 0d 3c 2f 70 72 65 3e 0d | 0d 3c 2f 62 6f 64 79 3e |.</pre>.|.</body>|
|00002400| 0d 3c 2f 68 74 6d 6c 3e | 0d 00 00 00 00 00 00 00 |.</html>|........|
|00002410| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002420| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002430| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002440| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002450| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002460| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002470| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002480| 00 00 01 00 00 00 08 9c | 00 00 07 9c 00 00 00 82 |........|........|
|00002490| 60 3a 1f 2e ff f0 1f 2e | ff f1 2f 0b 2f 39 ff fe |`:......|.././9..|
|000024a0| bf 1c 20 79 ff fe bf 1c | 20 50 20 68 00 54 4e 90 |.. y....| P h.TN.|
|000024b0| 0e 43 6f 6f 6b 69 65 20 | 45 78 61 6d 70 6c 65 20 |.Cookie |Example |
|000024c0| 2d 20 4d 43 50 20 28 75 | 74 73 6b 72 69 66 74 29 |- MCP (u|tskrift)|
|000024d0| 00 00 54 45 58 54 4a 79 | 57 73 01 00 ff ff ff ff |..TEXTJy|Ws......|
|000024e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000024f0| 00 00 ad c4 ca 34 00 00 | 24 4b 00 00 09 b0 2f 0a |.....4..|$K..../.|
|00002500| 4e b9 00 00 04 82 20 0a | 24 5f 4e 5e 4e 74 00 08 |N..... .|$_N^Nt..|
|00002510| 4e 56 00 00 2f 0a 24 6e | 00 08 42 67 2f 0a 4e b9 |NV../.$n|..Bg/.N.|
|00002520| 00 00 11 82 20 79 ff fe | c2 7c 24 88 25 6e 00 0c |.... y..|.|$.%n..|
|00002530| 00 08 20 0a 24 5f 4e 5e | 4e 74 00 08 4e 56 00 00 |.. .$_N^|Nt..NV..|
|00002540| 48 e7 00 28 28 6e 00 08 | 20 79 ff fe c2 7c 28 88 |H..((n..| y...|(.|
|00002550| 24 6c 00 08 70 6c d5 c0 | 20 52 b1 cc 66 04 70 00 |$l..pl..| R..f.p.|
|00002560| 24 80 20 79 ff fe c2 80 | 28 88 2f 0c 4e b9 00 00 |$. y....|(./.N...|
|00002570| 06 a2 4c df 14 00 4e 5e | 4e 74 00 04 4e 56 ff fc |..L...N^|Nt..NV..|
|00002580| 00 00 00 00 00 00 00 00 | 00 00 07 5a 00 5e 00 00 |........|...Z.^..|
|00002590| 00 00 00 0c 00 0a 00 03 | 00 00 00 09 55 56 55 55 |........|....UVUU|
|000025a0| 55 55 00 00 00 06 00 0e | 00 0a 00 10 00 00 00 0c |UU......|........|
|000025b0| 00 00 00 00 00 00 00 00 | 00 07 00 0c 00 0a 00 03 |........|........|
|000025c0| 00 00 00 09 55 56 55 55 | 55 55 00 00 00 0d 00 0e |....UVUU|UU......|
|000025d0| 00 0a 00 10 00 00 00 0c | 00 00 00 00 00 00 00 00 |........|........|
|000025e0| 00 0e 00 0c 00 0a 00 03 | 00 00 00 09 55 56 55 55 |........|....UVUU|
|000025f0| 55 55 00 00 00 15 00 0e | 00 0a 00 10 01 00 00 0c |UU......|........|
|00002600| 22 14 61 af 2f 51 00 00 | 00 2c 00 0c 00 0a 00 03 |".a./Q..|.,......|
|00002610| 00 00 00 09 55 56 55 55 | 55 55 00 00 00 34 00 0e |....UVUU|UU...4..|
|00002620| 00 0a 00 10 00 00 00 0c | 00 00 00 00 00 00 00 00 |........|........|
|00002630| 00 35 00 0b 00 09 00 04 | 00 00 00 09 00 00 00 00 |.5......|........|
|00002640| 00 00 00 00 00 36 00 0c | 00 0a 00 03 00 00 00 09 |.....6..|........|
|00002650| 55 56 55 55 55 55 00 00 | 00 6c 00 0b 00 09 00 04 |UVUUUU..|.l......|
|00002660| 00 00 00 09 00 00 00 00 | 00 00 00 00 1b 96 00 0c |........|........|
|00002670| 00 0a 00 03 00 00 00 09 | 55 56 55 55 55 55 00 00 |........|UVUUUU..|
|00002680| 1b 9f 00 0e 00 0a 00 10 | 00 00 00 0c 00 00 00 00 |........|........|
|00002690| 00 00 00 00 1b a1 00 0c | 00 0a 00 03 00 00 00 09 |........|........|
|000026a0| 55 56 55 55 55 55 00 00 | 1b a8 00 0e 00 0a 00 10 |UVUUUU..|........|
|000026b0| 00 00 00 0c 00 00 00 00 | 00 00 00 00 1b aa 00 0c |........|........|
|000026c0| 00 0a 00 03 00 00 00 09 | 55 56 55 55 55 55 00 00 |........|UVUUUU..|
|000026d0| 1b cf 00 0e 00 0a 00 10 | 00 00 00 0c 00 00 00 00 |........|........|
|000026e0| 00 00 00 00 1b d1 00 0c | 00 0a 00 03 00 00 00 09 |........|........|
|000026f0| 55 56 55 55 55 55 00 00 | 1b d5 00 19 00 12 00 10 |UVUUUU..|........|
|00002700| 01 00 00 18 00 00 00 00 | 00 00 00 00 1b ef 00 0c |........|........|
|00002710| 00 0a 00 03 00 00 00 09 | 55 56 55 55 55 55 00 00 |........|UVUUUU..|
|00002720| 1b f4 00 0e 00 0a 00 10 | 00 00 00 0c 00 00 00 00 |........|........|
|00002730| 00 00 00 00 1b f6 00 0c | 00 0a 00 03 00 00 00 09 |........|........|
|00002740| 55 56 55 55 55 55 00 00 | 1b fc 00 0e 00 0a 00 10 |UVUUUU..|........|
|00002750| 01 00 00 0c 00 00 00 00 | 00 00 00 00 1c 61 00 0c |........|.....a..|
|00002760| 00 0a 00 03 00 00 00 09 | 55 56 55 55 55 55 00 00 |........|UVUUUU..|
|00002770| 1c 6d 00 0e 00 0a 00 10 | 00 00 00 0c 00 00 00 00 |.m......|........|
|00002780| 00 00 00 00 1d 43 00 0c | 00 0a 00 03 00 00 00 09 |.....C..|........|
|00002790| 55 56 55 55 55 55 00 00 | 1d 4b 00 0e 00 0a 00 10 |UVUUUU..|.K......|
|000027a0| 00 00 00 0c 00 00 00 00 | 00 00 00 00 1e 6a 00 0c |........|.....j..|
|000027b0| 00 0a 00 03 00 00 00 09 | 55 56 55 55 55 55 00 00 |........|UVUUUU..|
|000027c0| 1e 72 00 0e 00 0a 00 10 | 00 00 00 0c 00 00 00 00 |.r......|........|
|000027d0| 00 00 00 00 1f 8c 00 0c | 00 0a 00 03 00 00 00 09 |........|........|
|000027e0| 55 56 55 55 55 55 00 00 | 1f 90 00 0c 00 0a 00 03 |UVUUUU..|........|
|000027f0| 00 00 00 09 00 01 00 01 | 00 01 00 00 1f 91 00 0e |........|........|
|00002800| 00 0a 00 10 00 00 00 0c | 00 00 00 00 00 00 00 00 |........|........|
|00002810| 1f 92 00 0c 00 0a 00 03 | 00 00 00 09 00 01 00 01 |........|........|
|00002820| 00 01 00 00 1f 96 00 0e | 00 0a 00 10 00 00 00 0c |........|........|
|00002830| 00 00 00 00 00 00 00 00 | 1f 97 00 0c 00 0a 00 03 |........|........|
|00002840| 00 00 00 09 55 56 55 55 | 55 55 00 00 1f 9d 00 0e |....UVUU|UU......|
|00002850| 00 0a 00 10 01 00 00 0c | 00 00 00 00 00 00 00 00 |........|........|
|00002860| 1f b0 00 0c 00 0a 00 03 | 00 00 00 09 55 56 55 55 |........|....UVUU|
|00002870| 55 55 00 00 1f b8 00 0e | 00 0a 00 10 00 00 00 0c |UU......|........|
|00002880| 00 00 00 00 00 00 00 00 | 1f ba 00 0c 00 0a 00 03 |........|........|
|00002890| 00 00 00 09 55 56 55 55 | 55 55 00 00 1f bd 00 0e |....UVUU|UU......|
|000028a0| 00 0a 00 10 00 00 00 0c | 00 00 00 00 00 00 00 00 |........|........|
|000028b0| 1f c5 00 0c 00 0a 00 03 | 00 00 00 09 55 56 55 55 |........|....UVUU|
|000028c0| 55 55 00 00 1f fb 00 0b | 00 09 00 04 00 00 00 09 |UU......|........|
|000028d0| 00 00 00 00 00 00 00 00 | 20 1f 00 0c 00 0a 00 03 |........| .......|
|000028e0| 00 00 00 09 55 56 55 55 | 55 55 00 00 20 28 00 0e |....UVUU|UU.. (..|
|000028f0| 00 0a 00 10 00 00 00 0c | 00 00 00 00 00 00 00 00 |........|........|
|00002900| 20 29 00 0c 00 0a 00 03 | 00 00 00 09 55 56 55 55 | )......|....UVUU|
|00002910| 55 55 00 00 20 2d 00 0e | 00 0a 00 10 00 00 00 0c |UU.. -..|........|
|00002920| 00 00 00 00 00 00 00 00 | 20 2f 00 0c 00 0a 00 03 |........| /......|
|00002930| 00 00 00 09 55 56 55 55 | 55 55 00 00 20 32 00 0e |....UVUU|UU.. 2..|
|00002940| 00 0a 00 10 00 00 00 0c | 00 00 00 00 00 00 00 00 |........|........|
|00002950| 20 33 00 0c 00 0a 00 03 | 00 00 00 09 55 56 55 55 | 3......|....UVUU|
|00002960| 55 55 00 00 20 69 00 0b | 00 09 00 04 00 00 00 09 |UU.. i..|........|
|00002970| 00 00 00 00 00 00 00 00 | 20 88 00 0c 00 0a 00 03 |........| .......|
|00002980| 00 00 00 09 55 56 55 55 | 55 55 00 00 20 95 00 0e |....UVUU|UU.. ...|
|00002990| 00 0a 00 10 00 00 00 0c | 00 00 00 00 00 00 00 00 |........|........|
|000029a0| 20 97 00 0c 00 0a 00 03 | 00 00 00 09 55 56 55 55 | .......|....UVUU|
|000029b0| 55 55 00 00 20 9a 00 0e | 00 0a 00 10 00 00 00 0c |UU.. ...|........|
|000029c0| 00 00 00 00 00 00 00 00 | 20 ca 00 0c 00 0a 00 03 |........| .......|
|000029d0| 00 00 00 09 55 56 55 55 | 55 55 00 00 20 ce 00 0e |....UVUU|UU.. ...|
|000029e0| 00 0a 00 10 00 00 00 0c | 00 00 00 00 00 00 00 00 |........|........|
|000029f0| 20 cf 00 0c 00 0a 00 03 | 00 00 00 09 55 56 55 55 | .......|....UVUU|
|00002a00| 55 55 00 00 20 d0 00 0e | 00 0a 00 10 00 00 00 0c |UU.. ...|........|
|00002a10| 00 00 00 00 00 00 00 00 | 20 d1 00 0c 00 0a 00 03 |........| .......|
|00002a20| 00 00 00 09 00 01 00 01 | 00 01 00 00 20 d5 00 0e |........|.... ...|
|00002a30| 00 0a 00 10 00 00 00 0c | 00 00 00 00 00 00 00 00 |........|........|
|00002a40| 20 d6 00 0c 00 0a 00 03 | 00 00 00 09 55 56 55 55 | .......|....UVUU|
|00002a50| 55 55 00 00 20 dc 00 0e | 00 0a 00 10 01 00 00 0c |UU.. ...|........|
|00002a60| 00 00 00 00 00 00 00 00 | 20 e7 00 0c 00 0a 00 03 |........| .......|
|00002a70| 00 00 00 09 55 56 55 55 | 55 55 00 00 20 ef 00 0e |....UVUU|UU.. ...|
|00002a80| 00 0a 00 10 00 00 00 0c | 00 00 00 00 00 00 00 00 |........|........|
|00002a90| 20 f0 00 0c 00 0a 00 03 | 00 00 00 09 55 56 55 55 | .......|....UVUU|
|00002aa0| 55 55 00 00 20 f3 00 0e | 00 0a 00 10 00 00 00 0c |UU.. ...|........|
|00002ab0| 00 00 00 00 00 00 00 00 | 21 08 00 0c 00 0a 00 03 |........|!.......|
|00002ac0| 00 00 00 09 55 56 55 55 | 55 55 00 00 21 0e 00 0b |....UVUU|UU..!...|
|00002ad0| 00 09 00 04 00 00 00 09 | 00 00 00 00 00 00 00 00 |........|........|
|00002ae0| 21 1c 00 0c 00 0a 00 03 | 00 00 00 09 55 56 55 55 |!.......|....UVUU|
|00002af0| 55 55 00 00 21 23 00 0e | 00 0a 00 10 00 00 00 0c |UU..!#..|........|
|00002b00| 00 00 00 00 00 00 00 00 | 21 29 00 0c 00 0a 00 03 |........|!)......|
|00002b10| 00 00 00 09 55 56 55 55 | 55 55 00 00 21 2f 00 0b |....UVUU|UU..!/..|
|00002b20| 00 09 00 04 00 00 00 09 | 00 00 00 00 00 00 00 00 |........|........|
|00002b30| 21 3c 00 0c 00 0a 00 03 | 00 00 00 09 55 56 55 55 |!<......|....UVUU|
|00002b40| 55 55 00 00 21 43 00 0e | 00 0a 00 10 00 00 00 0c |UU..!C..|........|
|00002b50| 00 00 00 00 00 00 00 00 | 22 33 00 0c 00 0a 00 03 |........|"3......|
|00002b60| 00 00 00 09 55 56 55 55 | 55 55 00 00 22 37 00 0e |....UVUU|UU.."7..|
|00002b70| 00 0a 00 10 00 00 00 0c | 00 00 00 00 00 00 00 00 |........|........|
|00002b80| 22 39 00 0c 00 0a 00 03 | 00 00 00 09 55 56 55 55 |"9......|....UVUU|
|00002b90| 55 55 00 00 22 3c 00 0e | 00 0a 00 10 00 00 00 0c |UU.."<..|........|
|00002ba0| 00 00 00 00 00 00 00 00 | 22 6d 00 0c 00 0a 00 03 |........|"m......|
|00002bb0| 00 00 00 09 55 56 55 55 | 55 55 00 00 22 73 00 0b |....UVUU|UU.."s..|
|00002bc0| 00 09 00 04 00 00 00 09 | 00 00 00 00 00 00 00 00 |........|........|
|00002bd0| 22 81 00 0c 00 0a 00 03 | 00 00 00 09 55 56 55 55 |".......|....UVUU|
|00002be0| 55 55 00 00 22 88 00 0e | 00 0a 00 10 00 00 00 0c |UU.."...|........|
|00002bf0| 00 00 00 00 00 00 00 00 | 22 b6 00 0c 00 0a 00 03 |........|".......|
|00002c00| 00 00 00 09 55 56 55 55 | 55 55 00 00 22 ba 00 0e |....UVUU|UU.."...|
|00002c10| 00 0a 00 10 00 00 00 0c | 00 00 00 00 00 00 00 00 |........|........|
|00002c20| 22 bc 00 0c 00 0a 00 03 | 00 00 00 09 55 56 55 55 |".......|....UVUU|
|00002c30| 55 55 00 00 22 bf 00 0e | 00 0a 00 10 00 00 00 0c |UU.."...|........|
|00002c40| 00 00 00 00 00 00 00 00 | 23 19 00 0c 00 0a 00 03 |........|#.......|
|00002c50| 00 00 00 09 55 56 55 55 | 55 55 00 00 23 1e 00 0b |....UVUU|UU..#...|
|00002c60| 00 09 00 04 00 00 00 09 | 00 00 00 00 00 00 00 00 |........|........|
|00002c70| 23 71 00 0c 00 0a 00 03 | 00 00 00 09 55 56 55 55 |#q......|....UVUU|
|00002c80| 55 55 00 00 23 77 00 0e | 00 0a 00 10 00 00 00 0c |UU..#w..|........|
|00002c90| 00 00 00 00 00 00 00 00 | 23 79 00 0c 00 0a 00 03 |........|#y......|
|00002ca0| 00 00 00 09 55 56 55 55 | 55 55 00 00 23 80 00 0e |....UVUU|UU..#...|
|00002cb0| 00 0a 00 10 00 00 00 0c | 00 00 00 00 00 00 00 00 |........|........|
|00002cc0| 23 81 00 0c 00 0a 00 03 | 00 00 00 09 55 56 55 55 |#.......|....UVUU|
|00002cd0| 55 55 00 00 23 88 00 0e | 00 0a 00 10 00 00 00 0c |UU..#...|........|
|00002ce0| 00 00 00 00 00 00 00 00 | 23 8f 00 0e 00 0a 00 10 |........|#.......|
|00002cf0| 00 00 00 0c 00 00 00 00 | 00 00 00 00 24 1e 00 0e |........|....$...|
|00002d00| 00 0a 00 10 00 00 00 0c | 00 00 00 00 00 00 00 00 |........|........|
|00002d10| 00 02 00 02 00 00 00 04 | 00 00 23 89 00 00 01 00 |........|..#.....|
|00002d20| 00 00 08 9c 00 00 07 9c | 00 00 00 82 04 3e fa 88 |........|.....>..|
|00002d30| 25 d4 00 00 00 1c 00 82 | 00 04 73 74 79 6c 00 00 |%.......|..styl..|
|00002d40| 00 2a 73 6f 75 70 00 00 | 00 36 38 38 35 39 00 00 |.*soup..|.68859..|
|00002d50| 00 42 4d 6f 44 45 00 00 | 00 4e 53 69 5a 45 00 00 |.BMoDE..|.NSiZE..|
|00002d60| 00 5a 00 80 ff ff 00 00 | 00 08 04 5d 64 c4 00 80 |.Z......|...]d...|
|00002d70| ff ff 00 00 00 00 04 5d | 64 bc 00 80 ff ff 00 00 |.......]|d.......|
|00002d80| 00 04 00 00 00 00 00 80 | ff ff 00 00 07 8e 04 5d |........|.......]|
|00002d90| 64 c8 00 80 ff ff 00 00 | 07 94 04 5d 64 f8 00 00 |d.......|...]d...|
|00002da0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002db0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002dc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002dd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002de0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002df0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+